class MumController < ApplicationController
  
  def index
    redirect_to user_home_url and return if logged_in?
    @last_msg = Message.last_located
  end
  
  def dondeesta
  	@user = User.find_by_login(params[:login])
  	redirect_to root_url and return if @user.blank?

  	@last_msg = @user.last_message_located
	unless params[:inp_mobile_num].blank?
		usu = User.find(:first, :conditions => ["login like ?",params[:login]])
		@mobile_num_ok = (!usu.blank? and (usu.mobile_mum == params[:inp_mobile_num])) ? true : false
		unless @mobile_num_ok
			flash[:alert] = "Teléfono incorrecto, vuelve a intentarlo"
		end
	end
  end
end
